<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>{$Think.lang.receivingaddress}-{$tpshop_config['shop_info_store_title']}</title>
    <meta http-equiv="keywords" content="{$tpshop_config['shop_info_store_keyword']}" />
    <meta name="description" content="{$tpshop_config['shop_info_store_desc']}" />
    <link rel="stylesheet" href="__STATIC__/css/index.css" type="text/css">
    <script src="__STATIC__/js/jquery-1.10.2.min.js"></script>
    <script src="__STATIC__/js/slider.js"></script>
</head>

<body>
<!--------头部开始-------------->
<include file="Public/header" />
<!--------头部结束-------------->
<script src="__PUBLIC__/js/layer/layer.js"></script><!-- 弹窗js 参考文档 http://layer.layui.com/-->

    <div class="breadcrumb-area">    
<div class="layout">
	    <foreach name="navigate_user" key="k" item="v">
	        <if condition="$k neq '首页'"> > </if>  
            <a href="{$v}">{$k}</a> 
        </foreach>
    </div>
</div>
<div class="layout pa-to-10 fo-fa-ar">
    <!--菜单-->
    <include file="User/menu" />
    <!--菜单-->
    <div class="fr wi872">
        <div class="he50 wddd">
            <div class="fl ddd-h2">
                <h2><span>{$Think.lang.myshdz}</span></h2>
            </div>
            <div class="fr ddd-h2">
            	<h2><a class="co-red addlist_btn" onClick="address_edit({$list['address_id']})"><span>+{$Think.lang.addaddress}</span></a></h2>
            </div>
        </div>

        <div class="wddd-js ov-in">
            <div class="list-group-title">
                <table class="merge-tab" border="0" cellpadding="0" cellspacing="0">
                    <thead>
                    <tr>
                        <th class="col-pro wi137">{$Think.lang.consignee}</th>
                        <th class="">{$Think.lang.receivingaddress}</th>
                        <th class="wi118">{$Think.lang.postcode}</th>
                        <th class="wi172">{$Think.lang.cellphone} </th>
                        <th class="col-operate wi199">{$Think.lang.operation}</th>
                    </tr>
                    </thead>
                </table>
            </div>
            <div class="merge-list">
          
                <div class="ma-0--1">
                    <div class="o-pro"><if condition="!$lists">
				<div id="tips_message">
					<div class="message_tipws_content">
						<div class="tips_img"><img src="__STATIC__/images/tips_message.png" style=" width:191px; height:186px;" ></div>
						<div class="tipws_content">
                            {$Think.lang.noaddress}
							<a href="javascript:void(0);" onClick="address_edit({$list['address_id']})"> {$Think.lang.addaddress}<i class="icon-chevron-right-circle"></i></a>
						</div>
						<div class="clear"></div>
					</div>
				</div></if>
                        <table border="0" cellpadding="0" cellspacing="0">
                            <tbody>
                            <volist name="lists" id="list">
                                <tr>
                                    <td class="col-pro wi137">{$list.consignee}</td>
                                    <td class="">
                                        <span>
                                        {$region_list[$list['province']]['name']}，{$region_list[$list['city']]['name']}，{$region_list[$list['district']]['name']}，{$region_list[$list['twon']]['name']} {$list.address}
                                        </span>
                                    </td>
                                    <td class="wi118">{$list.zipcode}</td>
                                    <td rowspan="1" class="wi172"><span>{$list.mobile}</span></td>
                                    <td rowspan="1" class="col-operate wi199">
                                        <p class="p-link  pfc"><a href="javascript:address_edit({$list['address_id']})">{$Think.lang.editor}</a></p>
                                        <p class="p-link  pfc"><a href="{:U('Home/User/del_address',array('id'=>$list['address_id']))}">{$Think.lang.delete}</a></p>
                                        <p class="p-link  pfc"><a class="red" href="{:U('Home/User/set_default',array('id'=>$list['address_id']))}">{$Think.lang.defaultaddress}</a></p>
                                    </td>
                                </tr>
                            </volist>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="he80"></div>
<!--------footer-开始-------------->
<include file="Public/footer" />
<!--------footer-结束-------------->


</body>
<script>
    /*$(function () {
     $("#h-s").click(function () {
     $('.ec-ta-x').css('left','124px');
     $('.ec-ta-x').css('width','110px');
     $(this).addClass("cullent");
     $('#q-s').removeClass("cullent");
     });
     });
     */
</script>

<script>
    $(function () {
        $(function () {
            $("#q-s").mouseover(function () {
                $('.ec-ta-x').css('left','0px');
                $(this).addClass("cullent");
            });
            $("#q-s").mouseout(function () {
                $('.ec-ta-x').css('left','0px');
            });
        });
        $("#h-s").mouseover(function () {
            $('.ec-ta-x').css('left','82px');
            $(this).addClass("cullent");
        });
        $("#h-s").mouseout(function () {
            $('.ec-ta-x').css('left','0px');
            $(this).removeClass("cullent");
        });
    });

    $(function () {
        $("#j-s").mouseover(function () {
            $('.ec-ta-x').css('left','164px');
            $(this).addClass("cullent");
        });
        $("#j-s").mouseout(function () {
            $('.ec-ta-x').css('left','0px');
            $(this).removeClass("cullent");
        });
    });
    /**
     * 新增修改收货地址
     * id 为零 则为新增, 否则是修改
     *  使用 公共的 layer 弹窗插件  参考官方手册 http://layer.layui.com/
     */
    function address_edit(id)
    {
        if(id > 0)
            var url = "/index.php?m=Home&c=User&a=edit_address&scene=1&call_back=call_back_fun&id="+id; // 修改地址  '/index.php/Home/User/add_address/scene/1/call_back/call_back_fun/id/id' //iframe的url /index.php/Home/User/add_address
        else
            var url = "/index.php?m=Home&c=User&a=add_address&scene=1&call_back=call_back_fun";	// 新增地址
        layer.open({
            type: 2,
            title: '{$Think.lang.addaddress_1}',
            shadeClose: true,
            shade: 0.8,
            area: ['880px', '580px'],
            content: url,
        });
    }
    // 添加修改收货地址回调函数
    function call_back_fun(v){
        layer.closeAll(); // 关闭窗口
        location.href = location.href;
    }
</script>
</html>